﻿using System;

namespace MultiViewer
{
    /// <summary>Rectangle in double coordinates</summary>
    /// <remarks>Vertical axis direction considered up,
    ///  so top as GE than bottom</remarks>
    [Serializable]
    public struct Rect
    {
        private double top;
        private double bottom;
        private double left;
        private double right;

        public Rect(double left, double bottom, double right, double top)
        {
            this.left = left;
            this.top = top;
            this.right = right;
            this.bottom = bottom;
        }

        public double Top
        {
            get { return top; }
            set { top = value; }
        }

        public double Bottom
        {
            get { return bottom; }
            set { bottom = value; }
        }

        public double Left
        {
            get { return left; }
            set { left = value; }
        }

        public double Right
        {
            get { return right; }
            set { right = value; }
        }

        public double Width
        {
            get { return right - left; }
        }

        public double Height
        {
            get { return top - bottom; }
        }
    }
}